<!--
 * @Author: chenhuanhuan 2925102113@qq.com
 * @Date: 2024-12-21 16:22:31
 * @LastEditors: chenhuanhuan 2925102113@qq.com
 * @LastEditTime: 2025-01-21 15:39:08
 * @FilePath: \hbzc-groupmeal-center-web\src\components\PopconfirmButton\index.vue
-->
<script setup lang="ts">
import { ref } from 'vue'
import { InfoFilled } from '@element-plus/icons-vue'
const emit = defineEmits(['confirm'])
const props = defineProps({
  text: {
    type: String,
    default: '删除'
  },
  content: {
    type: String,
    default: ''
  }
})
const clicked = ref(false)
function onCancel() {
  clicked.value = true
}
function onConfirm() {
  console.log(1223);
  emit('confirm')
}
</script>

<template>
  <el-popconfirm class="el-popconfirmPb" width="220" :icon="InfoFilled" icon-color="#0d968b"
    :title="content ? content : `确认${text}`" @confirm="onConfirm" @cancel="onCancel">
    <template #reference>
      <pb-button text size="small">{{ text }}</pb-button>
    </template>
    <template #actions="{ confirm, cancel }">
      <el-button size="small" @click="cancel">取消</el-button>
      <el-button type="danger" size="small" @click="confirm">
        确认
      </el-button>
    </template>
  </el-popconfirm>
</template>

<style lang="scss"></style>